package com.golang.common.dto;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;

/**
 * 接口请求头
 */
@Data
public class RequestHeader {

    private String ua;  //终端设备信息，设备型号。如Iphone14 iphone15 华为mate70
    private String ns;  //网络环境，如3g 4g 5g wifi
    private String version; //版本号
    private String deviceId; //设备ID
    private String systemVersion; //系统版本
    private String platform; //android/ios
    private String token; // 用户token

    @Override
    public String toString() {

        ObjectMapper mapper = new ObjectMapper();
        try {
            String jsonString = mapper.writeValueAsString(this);
            return jsonString;
        } catch (JsonProcessingException e) {
            return null;
        }
    }
}
